<UserControl x:Class="ResourceBlender_Express.ApplicationSelector"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:converters="clr-namespace:ResourceBlender_Express.Converters"
    xmlns:loc="clr-namespace:ResourceBlender_Express"
    Height="230" MinHeight="200" MinWidth="500">
    <UserControl.CommandBindings>
        <CommandBinding Command="NavigationCommands.Refresh" Executed="RefreshApplications" />
    </UserControl.CommandBindings>
    <UserControl.Resources>
        <ResourceDictionary>
            <converters:LanguageCodeListConverter x:Key="LanguageCodeListConverter" />
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3*" />
            <ColumnDefinition Width="3*" />
            <ColumnDefinition Width="3*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="170" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Label Grid.Row="0" Grid.Column="0">Application</Label>
        <ListBox x:Name="lstApplication" Grid.Row="1" Grid.Column="0"
                 ItemsSource="{Binding}" SelectionChanged="lstApplication_SelectionChanged"
                 Style="{StaticResource ApplicationRadioListTemplate}"></ListBox>
        <loc:ImageButton Grid.Row="2" Grid.Column="0" MinWidth="140" Command="NavigationCommands.Refresh"
                         Text="Refresh Applications" Image="pack://application:,,/Resources/images/refresh_16.png" ImageLocation="Left" />

        <Label Grid.Row="0" Grid.Column="1">Bundles</Label>
        <ListBox x:Name="lstBundles" Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" ItemsSource="{Binding ElementName=lstApplication,Path=SelectedValue.Bundles}" ItemTemplate="{StaticResource DictionaryList}" SelectedValuePath="Key" SelectionMode="Extended" SelectionChanged="lstBundles_SelectionChanged" />

        <Label Grid.Row="0" Grid.Column="2">Languages</Label>
        <ListBox x:Name="lstLanguages" Grid.Row="1" Grid.Column="2" Grid.RowSpan="2" ItemsSource="{Binding ElementName=lstApplication,Path=SelectedValue.Languages,Converter={StaticResource LanguageCodeListConverter}}" ItemTemplate="{StaticResource DictionaryList}" SelectedValuePath="Key" SelectionMode="Extended" SelectionChanged="lstLanguages_SelectionChanged" />
    </Grid>
</UserControl>
